#ifndef __HTTP_CLIENT_H__
#define __HTTP_CLIENT_H__


#include <string>
#include <boost/asio.hpp>
#include "HttpResponse.h"

using namespace std;
using namespace boost;
using boost::asio::ip::tcp;


class CHttpClient
{
public:
    CHttpClient();
    ~CHttpClient();

    bool Get(const string &url, CHttpResponse &response);

protected:
    void SplitUrl(const string &url, string &domain,
		  string &port, string &path);
    void Conncet(tcp::socket &socket, const string &domain, const string &port);
    void Send(tcp::socket &socket, const string& data);
    void Recv(tcp::socket &socket, string& data);


private:
    asio::io_service m_ioservice;
    static const string http_scheme;
};

#endif //__HTTP_CLIENT_H__

